#include "rtpdata_recieve_thread.h"


rtpdata_recieve_thread::rtpdata_recieve_thread(QObject *parent) :
    QThread(parent)
{
//    refresh_timer=new QTimer();
//    connect(refresh_timer,SIGNAL(timeout()),this,SLOT(save_video_file()));
//  //  refresh_timer->start(10000);
    rtpreciever.init_rtplib(LOIPADDR,8000,8008);
}

void rtpdata_recieve_thread::run()
{


    while(1)
    {
      if(!lock) {
          lock=true;
          rtpreciever.recieve_rtp_data( recbytes );
          lock=false;
      }

        msleep(50);
    }
}


void rtpdata_recieve_thread::save_video_file()
{
    videoFile->flush();
}
